import Vue from 'vue'
import Router from 'vue-router'
import goods from '@/components/goods/goods'
import seller from '@/components/seller/seller'
import ratings from '@/components/ratings/ratings'
import header from '@/components/header/header'

Vue.use(Router);

export default new Router({
  linkActiveClass: 'active',//修改 active 自定义class
  routes: [
    {path: '/', redirect: 'goods'},//设置默认路由
    {
      path: '/goods',
      name: 'goods',
      component: goods,
      meta: {
        keepAlive: true // true 表示需要使用缓存
      }
    },
    {
      path: '/seller',
      name: 'seller',
      component: seller,
      meta: {
        keepAlive: true // true 表示需要使用缓存
      }
    },
    {
      path: '/ratings',
      name: 'ratings',
      component: ratings,
      meta: {
        keepAlive: true // true 表示需要使用缓存
      }
    }
  ]
})
